package com.project.controller;

import com.project.service.ICusReturnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("cusReturn")
public class CusReturnController {
    @Autowired
    private ICusReturnService cusReturnService;
    /**
     * 接收退货订单信息--根据接收的订单，生成退货订单
     * @param orderNum  订单编号
     * @return  是否接收成功
     */
    @RequestMapping("getOrder")
    String getOrder(String orderNum){
        return cusReturnService.getOrder(orderNum);
    }
    /**
     * 客户退货--根据退货id，查询出商品的数量进行退货
     * @param returnOrder  退货订单编号
     * @return  是否接收成功
     */
    @RequestMapping("cusReturn")
    String  cusReturn(String returnOrder){
        cusReturnService.cusReturn(returnOrder);
        return "ok";
    }
}
